package com.w3c.pragmatic.common.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 异常类
 *
 * @author wangdong
 * @since 2024-04-22
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class BusinessException extends RuntimeException {

  private String code;
  private String message;

  public BusinessException(String message) {
    super("BusinessException: " + message);
    this.message = message;
  }

  public BusinessException(String code, String message) {
    super("BusinessException[" + code + "]: " + message);
    this.code = code;
    this.message = message;
  }
}
